3 HALFCUT = 0; // cut it at all
4 CUT = 1; // side: left or right 0 / 1
6 // ----------- testing ---------------------
7 CUT_DIA = 0; // diametrical cut (for testing)
14 // ---------- main settings ----------------
27 ERR = 0.1; // to remove thin junction walls
29 EXT = 2; // to extend inner caves & notches
32 // ---------- rounded rectangle ------------
34 module roundedBody( w, h, l, r ){
38 // translate([0, 0, 0])
41 translate([0, w, 0]) cylinder( l, r, r );
42 translate([h, 0, 0]) cylinder( l, r, r );
43 translate([h, w, 0]) cylinder( l, r, r );
47 // color("blue") roundedBody( 20, 10, 10, 5 );
49 // ---------- pancake (4 light) -----------
51 module pancake(r1,h,r2){
52 translate([0, 0, r2]) minkowski(){
53 cylinder(h-r2*2,r1-r2,r1-r2);
58 // ---------- holder (vertical part) -------
62 [ tan(angle), 0, 1, 0 ],
65 module verticalPart(){
69 translate([85,0,28]) color("red") pancake(22,22,9.9);
71 roundedBody( width-2, height-2, length, width/2 );
72 roundedBody( width-4, height-4, length, width/2 );
78 multmatrix(M) roundedBody( width, height, length, width/2 );
80 translate([-40, (width+1)/2, -10 - lift]) rotate([90,0,0]) color("red") roundedBody( 60, 80, width+1, width/4 );
84 translate([85,0,28]) color("red") pancake(20,20,9.9);
85 translate([0,0,-1]) glassNotch();
87 translate([51, 0, 31]) color("red") {
88 translate([-2, 0, 4]) cube([27, 17 + 2 + EXT, 8], center=true);
89 translate([4, 0, 5]) cube([15 + EXT, 17 + 2 + EXT, 10], center=true);
91 translate([10, -EXT/2, 7]) rotate([0,90,0]) color("red") translate([0, -4, 0]) roundedBody( 12 + EXT, 6, 10, 2 );
94 translate([1 - 2, 0, -20]) cylinder(20, 1.2 + EXT/2, 1.2 + EXT/2);
95 translate([1 - 2, 0, -5]) cylinder(6, 5+1, 5+1);
98 translate([54, 0, -3]) color("red") sphere(20);
102 translate([35, -44, 31]) translate([0,30,0]) rotate([90,0,0]) cylinder( 18,3,3, center=true);
106 translate([35, 0, 25 + EXT/2]) color("red") cube([5 + EXT, 34 + EXT,23 + 1 + EXT], center=true); // charger
107 translate([35 - EXT/2,-12 - EXT/2,6]) roundedBody( 12 + EXT/2, 7 + EXT/2, 10 + EXT, 3 ); // usb hole
113 translate([15,0,79]) color("red") {
114 translate([0,62/2,0]) rotate([90,0,0]) cylinder(62,boltDia/2,boltDia/2); // bolt 62mm
115 translate([0,-width/2+3,0]) rotate([90,0,0]) cylinder(6,6,10);
116 translate([0,width/2+3,0]) rotate([90,0,0]) cylinder(6,10,6);
119 translate([15,0,31]) color("red") {
120 translate([0,62/2,0]) rotate([90,0,0]) cylinder(62,boltDia/2,boltDia/2); // bolt 62mm
121 translate([0,-width/2+3,0]) rotate([90,0,0]) cylinder(6,6,10);
122 translate([0,width/2+3,0]) rotate([90,0,0]) cylinder(6,10,6);
129 // ---------- neo (horisontal part) --------
131 module neoHolder( w, h, l, thin ){
138 translate([0, 0, BMRad/2])
140 roundedBody( w+thin*2 - BMRad, h+thin*2 - BMRad, l - BMRad, (w+thin*2 - BMRad)/2 );
143 translate([-EXT/2, -EXT/2, thin + MRad/2 + ERR -1]) color("red")
145 roundedBody( w-MRad + EXT, h-MRad + EXT, l-MRad, (w-MRad)/2 );
149 rotate([90, 0, 0]) translate([16 - EXT/2, 18-2, -50]) roundedBody(20,12 + EXT,100,3); // micro usb hole
150 rotate([90, 0, 0]) translate([8, 20 - 1, 0]) cylinder(100,3/2,3/2); // button hole
151 rotate([90, 0, 0]) translate([70 + 1,20,-40]) cylinder(20,3/2,3/2); // left button hole
153 translate([-50,0.5,-10]) rotate([50, 0, 90]) roundedBody(25,5,50,3); // center safty hole
155 translate([17,-27,13]) rotate([90, 0, 90]) roundedBody(18,20,4,6); // usb wire channel
159 translate([-roundPad - EXT/2, -roundPad - EXT/2, thin + 5]) color( "green" ) roundedBody( w+roundPad*2 + EXT, h+roundPad*2 + EXT, l * 0.28, w/2 );
165 // ---------- soft connect -----------------
167 module softConnect( width, height, raduis ){ // inner size
169 w = width + raduis*4;
170 h = height + raduis*4;
174 rotate_extrude(convexity = 0) translate([w/2-raduis, 0, 0]) circle(raduis);
175 color("green") translate([-w/2, 0, -raduis]) cube([w, w/2, raduis*2]);
178 module roundedSubObject(){
180 translate([0, h-w, 0]) rotate([0, 0, 180]) halfTorus();
181 translate([w/2-raduis, -ERR/2, 0]) rotate([-90,0,0]) cylinder(h-w+ERR,raduis,raduis);
182 translate([-(w/2-raduis), -ERR/2, 0]) rotate([-90,0,0]) cylinder(h-w+ERR,raduis,raduis);
185 rotate([0, 0, 90]) roundedBody( w-raduis*2, h-raduis*2, raduis, (w-raduis*2)/2 );
191 // ---------- handle bar -----------------
193 handleR = 27/2; // diameter of vertical part of the
194 handleR2 = 32/2; // 35/2 // diameter of horisontal part
195 handleAng = 25; // 20
203 translate([0,0,-10]) scale([1, horScale, 1]) cylinder( 86, handleR, handleR);
206 translate([95, 0, 83]) rotate([0, -90-handleAng, 0]) scale([1, horScale, 1]) linear_extrude(height=100, scale=[1.3,0.77], slices=20, twist=0) circle(handleR2);
208 // wire aound the handle bar
209 color("red") intersection(){
210 translate([88, 0, 80]) rotate([0, -90-handleAng, 0]) linear_extrude(height=100, scale=[1.4,0.9], slices=20, twist=0) scale([1, horScale, 1]) circle(handleR2);
211 rotate([0, -90-handleAng+5, 0]) translate([0,0,-46]) cylinder(6,100,100);
216 // ---------- main part ------------------
220 translate([0, 0, length]) multmatrix(M) rotate([0,0,-90]) softConnect( width, height, 8 );
221 translate([0, 0, length + 8 - ERR]) rotate([0, -angle, 0]) translate([-1,0,0]) neoHolder(neo_w, neo_h, neo_l, 10 );
227 translate([0,0, 20 + lift ]) holder(); // main part
228 translate([0,0,50]) handle(); // handle bar
230 // under device holes
232 translate([0,0,120+lift]) rotate([0, 90-angle, 0]) color("red") {
233 translate([-2, -18+3 - EXT/2, 57]) rotate([0,90,0]) roundedBody(36 + EXT, 52 + EXT,14,3); // battery hole
234 translate([-2, -18+10 - EXT/2, 10]) rotate([0,90,0]) roundedBody(36 + EXT, 37,8,10); // plug usb place
235 translate([-6, -20, 12.5]) cube([20,20,6]); // plug usb channel
239 translate([34, 0, 77]) rotate([0, -handleAng + 5, 0]) color("red") translate([2,0,30]) cube([6,4,65], center=true);
246 translate([-neo_h/2,0 , 0]) cube([neo_h*1.5, neo_w*2, length*2.5]);
248 mirror([0,1,0]) translate([-neo_h/2,0 , 0]) cube([neo_h*1.5, neo_w*2, length*2.5]); // vertical cutter
251 // perpendicular testing cutter
254 mirror([1,0,0]) translate([-neo_h/3,0 , 0]) cube([neo_h*1.5, neo_w*2, length*2.5]);
261 // projection(cut=true) translate([0,0,0]) rotate([90,0,0]) // to make flat cut projection for SVG testing export
263 translate([0,0,-105]) // to make flat cut projection for SVG testing export
269 // ---------- control mesurement ----------
275 translate([rad,rad,rad]) color("purple") minkowski() {
276 translate([outerRad,outerRad,0]) roundedBody(62-rad*2, 120-rad*2, 19-rad*2, outerRad );
279 translate([39,0,0]) rotate([90,0,0]) translate([0,19/2,-100/2]) color("green") cylinder(100,1,1); // 39 button
280 translate([50,0,0]) rotate([90,0,0]) translate([0,19/2,-100/2-62/2]) color("green") cylinder(100,1,1); // 50 usb + jack
281 translate([120-19,0,0]) rotate([90,0,0]) translate([0,19/2,-100/2-62/2]) color("green") cylinder(100,1,1); // 19 from top, button left
284 if ( BODY ) translate([0, 0, 122 + lift]) rotate([0,-angle,0]) translate([-35,-31,0]) neoDummy() // neo dummy
286 if ( HELPERS ) translate([10, -18+3, length + 36 + lift]) rotate([0, 90-angle, 0]) color("purple") roundedBody(35,10,50,3); // battery
288 if ( HELPERS ) translate([0, 0, 20]) {
289 translate([20, 0, 77]) rotate([0, -110, 0]) color("red") cube([36,1,1], center=true);
290 translate([0, 0, 100]) rotate([0, 90, 0]) color("red") cube([10,1,1], center=true);
291 translate([5, 0, 70]) rotate([0, 90, 0]) color("red") cube([70,1,1], center=true);
292 translate([-5, 0, 61]) rotate([0, 90, 0]) color("red") cube([88,1,1], center=true);
293 translate([0, 0, 16]) color("red") cylinder(19,39/2,35/2);
294 translate([0, 0, 6]) color("red") cylinder(10,50/2,50/2);
295 translate([45, 0, 100]) rotate([0, -18, 0]) color("red") cube([67,1,1], center=true);
297 translate([0,62/2,0]) rotate([90,0,0]) color("red") cylinder(62,3/2,3/2); // bolt 62mm